//package com.backend.config;
//
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
//
//@Configuration
//public class WebConfig extends WebMvcConfigurationSupport {
//
//	/**
//	 * springboot 2.0配置WebMvcConfigurationSupport之后，会导致默认配置被覆盖，要访问静态资源需要重写addResourceHandlers方法
//	 */
//
//	static final String IMG_PATH = System.getProperty("user.dir") + "/upload/";
//
//	@Override
//    public void addResourceHandlers(ResourceHandlerRegistry registry) {
//		registry.addResourceHandler("/**")
//				.addResourceLocations("classpath:/resources/")
//				.addResourceLocations("classpath:/static/")
//				.addResourceLocations("classpath:/public/");
//		registry.addResourceHandler("/upload/**")
//                .addResourceLocations("file:"+IMG_PATH);
//		super.addResourceHandlers(registry);
//    }
//}
